*MENU
PCbug11's command line can be edited using a number of keys on the host
computer. In addition there is a recall buffer which holds the last 16
commands entered. The following keys provide the edit and recall
features:

left arrow     - move cursor back 1 character
right arrow    - move cursor forward 1 character
Home           - move cursor to first character
End            - move cursor to last character
delete left    - delete to left of cursor
Del            - delete at cursor position
CTRL End       - delete from cursor position to end of line
Ins            - insert at cursor position (cursor changes to blocked
               cursor)
up arrow       - recall last entered command
down arrow     - recall last command in recall buffer
Esc            - Clear command line

In addition, the Esc key can be used to terminate most commands in
progress. e.g. MD, DASM, ASM.
The 4 lines above the command line provide a trace of  the last 4
commands executed.
The next line above this displays break point and last error messages.

An error code is returned to MS-DOS, with one of the following meanings:
Error Code     Meaning
----------     -------
     0         No error
     1         VERF error
     2         MS or BF error
     3         Talker communication failure.

In MS-DOS Batch files the error code can be checked with ERRORLEVEL.


Monitor  Commands

The following is a list of all commands available from PCbug11, with a
short description of their function. A more detailed description
follows.

PCbug11 Command Summary

ASM addr [mne|dir]            - Call symbolic macro line assembler, with
                              option to auto insert mnemonic or
                              directive
BAUD [rate]                   - Display/Set serial baud rate
BF addr1 [addr2] byte|word    - Block fill memory with byte or word
BL                            - Display breakpoints
BR [addr [macroname]]         - Display/Set break point
                              [with optional Command Macro execution]
CALL addr                     - Execute the subroutine at addr
CLRM                          - Clear all Command Macros
CLS                           - Clear main window
CONTROL [parameter]           - Display/Change PCbug11 system
                              parameters
DASM addr1 [addr2]            - Disassemble from addr1 [to addr2]
DB startaddr [endaddr]        - Display MCU Memory
DEBUG                         - Reserved word
DEFINE symbol value|address   - Define a symbol
DEFM macrnam|TRACE|AUTOSTART  - Define Command,Trace or Autostart
                              Macro
DELM macrnam|TRACE|AUTOSTART  - Delete Command,Trace or Autostart
                              Macro
DIR [mask]                    - Display Disk Directory
DOS [command]                 - Shell to DOS/Execute DOS command
EDITM macrnam                 - Edit a macro
EEPROM [startaddr [endaddr]]  - Display/Clear/Set EEPROM Address
                              Range(s)
EEPROM DELAY option           - Set EEPROM erase/write programming
                              time
EEPROM ERASE [option]         - Display/Change EEPROM Erase-before-
                              Write
EPROM [startaddr [endaddr]]   - Display/Clear/Set EPROM Address
                              Range(s)
EPROM DELAY option            - Set EPROM erase/write programming
                              time
FIND byte|word addr1 addr2    - Find all occurrences of byte or word
                              between addr1 & addr2
FIND mnemonic addr1 addr2     - Find all occurrences of mnemonic
                              between addr1 & addr2
G [addr]                      - Start User Code Execution
HELP                          - Display Help Information
KLE                           - Kill last error message
LOADM [filename] [macroname]  - Load Macro Definitions from Default/User
                              File
LOADS filename [loadaddr]     - Load S Record File into MCU Memory
LS symbol                     - Display symbols
LSTM [mname|TRACE|AUTOSTART]  - Display Macro Names/Definitions
MD startaddr [endaddr]        - Display MCU Memory
MM addr                       - Modify memory from addr
MOVE addr1 addr2 addr3        - Move MCU Memory between addr1 &
                              addr2 to addr3
MS addr byte|word [byte|word] - Set MCU Memory Byte(s) or Word(s)
MSG [string]                  - Display Message in Main Window
NOBR [address]                - Remove all/specified Break Points
PAUSE [ms]                    - Wait for any Key Press/Delay Time
PRINT                         - Display PCbug11 version number
PROTECT [startaddr [endaddr]] - Display/Clear/Set Write Protected
                              Address Range(s)
QUIT [Y]                      - Terminate PCbug11 session [without
                              confirming]
RD [T]                        - Display/Trace MCU Registers
RESET [addr]                  - MCU Hardware Reset with Existing/New
                              Reset Vector.
RESTART [option]              - Restart PCbug11 with Same/New Option.
RM                            - Modify MCU Registers in window
RS register value             - Set value of MCU register
S                             - Stop User Code Execution
SHELL ["command" ;P]          - Shell to DOS/ Execute DOS command
SAVEM [filename]              - Save Macro Definitions in Default/User
                              File
T [addr]                      - Trace User Code
TERM [X1 Y1 X2 Y2]            - Simple windowed terminal emulator
TYPE filename                 - Display Disk file in Main Window
UNDEF symbol                  - Undefine a symbol
VER                           - Display version number
VERF ERASE addr1 [addr2]      - Verify that memory contains $FF
VERF SET addr1 addr2 value    - Verify that memory contains value
VERF filename [memaddr]       - Verify S record disk file against memory
WAIT [ms]                     - Wait for ms

Special Key operations:
CTRL B                        - Send Break on COM channel
CTRL P                        - Toggle MCU Memory Write Protect/RTS
                              line
CTRL R                        - Attempt to re-synchronise talker

EVM Compatible commands

These commands operate in a similar manner to the command of the same
name on the Motorola 68HC11 EVM systems.

ASM, BF, BR, G, HELP, MD, MM, NOBR, RD, RM

CDS8 Compatible commands

These commands operate in a similar manner to the command of the same
name on the Motorola CDS8 system.

ASM, BAUD, DB, DEFINE, G, HELP, LS, RD, RS, SHELL, T, UNDEF, VER, WAIT
*ASM addr [mne|dir] - Call symbolic macro line assembler, with
                    option to auto insert mnemonic/directive

Provides single line assembly/disassembly in main window.
The assembler is a single pass version of ASMHC11 2.6 and thus supports
the same mnemonics and directives. Symbols can be defined within ASM
using the standard Motorola syntax. Alternatively, symbols from an
(equate) file may be loaded using the INCL operand. Note that mnemonics
must be preceded by at least one space following the '>' prompt,
otherwise they are treated as labels The same text editing features are
available as on the command line.
The following keys provide additional features:

up arrow       decrement prog counter by one.
down arrow     increment prog counter by one.
enter          move prog counter to next instruction boundary.
Esc            Exit ASM and return to command line.

In PCbug11 there is the ability to optionally specify on the command
line, a mnemonic or directive. If this is done, the ASM command
automatically inserts the mnemonic or directive, and immediately returns
to the command line. This allows mnemonic insertion or ASM directives to
be executed from within a macro, without any input from the user.

Usage:
ASM $100       Assemble from memory address $100
ASM $100 INCA  Insert INCA instruction at memory address $100

ASM Error messages
These are reported in the form of numbers the key to which is shown
below

Error no. Meaning

1         Memory fault   : Memory did not modify as expected
200       Syntax         : Illegal character in that context
202       Syntax         : Syntax error
204       Syntax         : Label required (for EQU or SET)
212       Operand        : Improper termination of operand field
213       Operand        : Illegal addressing mode for operand
214       Address        : Illegal forward reference
223       Address        : Invalid addressing mode for 68HC11
234       Symbol         : Redefined symbol
235       Symbol         : Undefined symbol
238       Symbol         : Undefined operation
320       Symbol         : Error table overflow
321       Symbol         : Symbol table overflow
250       Data           : Displacement too large (normally branch)
251       Data           : Value out of range
252       Data           : Address too large for forced direct
255       Data           : Division by zero

501       File           : File not found
*BAUD [rate]   - Display/Set serial baud rate

Allows user to change the PC's serial baud rate. This command accesses
the PC's hardware directly, to allow a wider range of baud rates than
can be selected by the  MODE command. After execution, the actual baud
rate is displayed. This may be different to the requested baud rate.
Values in excess of 9600 are available - with a maximum of 38400 baud.

Note 1: To maintain Talker contact, the MCU's baud rate must first be
set up to the new value. This can either be done by changing the
appropriate talker code, or executing an MS command to dynamically
change the MCU's baud rate register.

Note 2: The default baud rate for bootstrap download is approximately
7812, and for talker communication it is 9600. These may be changed by
specifying a different baud rate when PCbug11 is started from the MS-
DOS? command line. This feature has been added to allow PCbug11 and all
talker codes to work without modification with different MCU crystal
frequencies. e.g. if the MCU crystal is 4MHz, then to start up an
MC68HC11A8 in bootstrap mode the command is: PCBUG11 -A 3906 This will
ensure that PCbug11 uses half the default values (i.e 3906=7812/2) for
both download and TALKER communication.

Note 3: Changing the baud rate will affect the minimum EEPROM
programming time, as the EEPROM programming algorithm used by PCbug11
relies on the serial data transfer time.

Usage:
BAUD           Display current Serial baud rate.
BAUD 19200     Change baud rate to 19200 baud.
*BF addr1 [addr2] byte|word        - Set MCU Memory Byte(s) or Word(s)

This command forces an 8 bit or 16 bit value into MCU memory, starting
at address <addr1> and finishing at address <addr2>. If <addr2> is not
specified then only <addr1> itself is modified. If the starting address
is in an EEPROM block (as specified by the EEPROM command), then an
EEPROM algorithm will be used to store the value. This action is
completely transparent to the user. Block fill automatically verifies
the contents of memory filled.

Note: When setting memory to $00, ensure that the $00 is not specified
in the most significant byte of a 16 bit value, as this will be
interpreted as an
8 bit value and may result in incorrect addressing of MCU memory.

Usage:
BF $1000 $AA        Set MCU memory address $1000 to a value of $AA
BF $C000 $CFFF $D3  Set MCU memory addresses $C000 to $CFFF to the value
                    $D3.
BF $00 $FF $FF00    Set MCU memory addresses $00 to $FF to values
                    $FF,$00,$FF,$00 alternately.

Related commands: DB,MD,MS
*BL            - Display Breakpoints

This command displays the list of current breakpoints. The breakpoint is
displayed in hexadecimal format and followed by a macro name if one is
defined.

Usage:
BL                  Display the hexadecimal address of all user defined
                    breakpoints. Any command macro tagged to the
                    breakpoint is displayed in brackets () after the
                    breakpoint

Related commands: BR,NOBR
*BR [addr [macroname]]   - Display/Set break points [with optional
                         Command Macro execution]

This command installs an entry in a breakpoint table, to permit
suspension of user code execution initiated by the G command.

Breakpoints are set in MCU memory only when the user starts execution of
code with the G command. Before control is passed to user code, a SWI
instruction is placed at every breakpoint address specified in the
breakpoint table. PCbug11 can handle user placed SWIs, with some
overhead, provided the user's SWI vector is downloaded from an S record
file using the LOADS command, and there are no breakpoints at the user
SWI instructions. Note that when PCbug11 is first started, it reads the
MCU's SWI vector and treats it as the user's.

It is possible to have a macro run on reaching a particular breakpoint.
If the macro is not defined then PCbug11 will behave as if no macro had
been specified. If when listing breakpoints the macro selected is not
defined then the name of the macro is displayed preceded by ?. If no
macro has been defined for the breakpoint then the macro is displayed as
(-).

Usage:
BR                  Display the hexadecimal address of all user defined
                    breakpoints. Any command macro tagged to the
                    breakpoint is displayed in brackets () after the
                    breakpoint address.
BR $C0F1 $C045      Set breakpoints at MCU addresses $C0F1 and $C045.
BR $C023 DISPREG    Set breakpoint at MCU address $C023 and execute
                    macro DISPREG  when the breakpoint is reached.

Related commands: BL,NOBR
*CALL addr          - Execute the subroutine at addr

This command causes the monitor to execute the MCU code located at
<addr>. The MCU code must be terminated by an RTS instruction, otherwise
monitor operation may be affected. The command has the same affect as
the MCU instruction JSR <addr>. The current state of the monitor is
unaffected.

Related command:  G
*CLRM               - Clear all Command, Trace and Autostart Macros

This command removes all macro names and definitions from the current
library, including the TRACE macro. It does not affect libraries stored
on disc with the SAVEM command.

Related commands: DEFM,DELM,EDITM,LSTM,SAVEM,LOADM
*CLS                     - Clear the main window

This command clears the main (blue) window on the screen. It also clears
the last error/breakpoint messages if they are present.

Related commands: KLE
*CONTROL [parameter]     - Display/Change PCbug11 system parameters

If no parameters are specified, then this command displays certain
parameters used by PCbug11, which can be modified by the user. The
available parameters and their functions are as follows:

CONTROL HARDWARE         Access serial COM port directly through
                         hardware
CONTROL BIOS             Access serial COM port through BIOS calls
CONTROL RTS              Control RTS level directly.
CONTROL PROTECT          Use RTS to provide memory write protect
                         function
CONTROL TIMEOUT value    Specify value of serial COM timeout during
                         input
CONTROL COM1|COM2        Specify which COM port to use
CONTROL ERRMSG 0|1       Disable or enable display of memory error
                         messages
CONTROL LAST             Toggle last error message window on/off
                         (default on)

On startup, PCbug11 determines whether hardware access is possible, and
if so, it uses this mode, and enables direct control of the RTS,
otherwise it uses BIOS calls to the COM port, and enables memory write
protect control. COM1 is used by default, but can be changed by
specifying port=2 on the command line when starting PCbug11. e.g.
PCBUG11 -A port=2
(See DEFM,SAVEM,LOADM for details of macro libraries)
*DASM addr1 [addr2]           - Disassemble from addr1 [to addr2]

Disassembles MCU memory from address <addr1> for approximately 15 bytes,
or to address <addr2> if specified. Disassembled code is displayed in
main window. Display halts when the screen is filled. Press any key,
except Esc, to continue disassembly for up to 15 bytes, or until address
<addr2> is exceeded. Pressing Esc key immediately terminates
disassembly. If only addr1 is specified, and it is the same as the
current program counter, then disassembly stops after only one line is
displayed.
This provides a convenient method of tracing program code when using a
Trace macro, which should contain the command: DASM *. Note that DASM
will display a symbol in place of its value if one exists.

Usage:
DASM $B3                 Disassembles MCU addresses $B3 to $C2
DASM $BF00 $BFFF         Disassembles MCU addresses $BF00 to $BFFF

Related command: ASM,LS
*DB startaddr [endaddr]       - Display MCU memory

This command displays the contents of memory starting at <startaddr> and
ending at <endaddr>. If <endaddr> is not specified then the contents of
<startaddr> and the following 15 locations are displayed.

Usage:
DB $1000            Display MCU memory addresses from $1000 to $100F
DB $C000 $CFFF      Display MCU memory addresses from $C000 to $CFFF

Related commands: BF,MS,MD
*DEBUG              - Reserved word

This command is reserved by PCbug11 for development use. Macros cannot
be labelled using this name.
*DEFINE symbol value|address       - Define a symbol

This command allows the user to explicitly define the value of a symbol.
Each symbol has a name and a value.

The symbol name may consist of lower and/or upper case letters. The case
of each letter is sensitive. That is abc does not equal ABC. In use
symbols are simply replaced by their value in commands and the value is
replaced by the symbol name in a disassembly listing.

Usage:
DEFINE PORTA $1000       Define symbol PORTA=$1000
DEFINE mask1 45          Define mask1=45 ($2D)

Related commands: LS,UNDEF
*DEFM macroname|TRACE|AUTOSTART]   - Define Command, Trace or
                                   Autostart Macro

This command allows users to create command sequences (macros), which
can be executed simply by typing the name of the macro. Up to 10
parameters can be passed to command macros. Within the macro, the
required parameter is specified by the operator @N, where N is a single
digit number between 0-9 inclusive. The syntax and use of pass
parameters is the same as found in Motorola's assemblers. <macroname>
can be any sequence of alphanumeric characters except reserved command
names. Macros can be nested up to 5 levels. More than one macro is
allowed at a time and these are held in an area known as the macro
library. Macro libraries can be saved on disk and loaded again when
required.

The reserved parameter name TRACE allows the user to define a macro
which is executed on completion of every T (trace) command. See T for
further details.

The reserved parameter name AUTOSTART allows the user to define a macro
which is executed automatically on startup of PCbug11. To correctly use
the AUTOSTART feature, the macro library containing the macro AUTOSTART
must be saved using the SAVEM command. Then, from MS-DOS?, the macro
library name must be specified as the last parameter on the command
line.
e.g. From PCbug11:
     DEFM AUTOSTART
     (type in macro definitions in main window. then press Esc key)
     SAVEM STARTUP
     QUIT      (Quits PCbug11)

Then from PC command line:
     PCBUG11 -A STARTUP
     (STARTUP library is loaded and AUTOSTART executed, if it exists)

The main window is used to type in the macro definition. Other macro
names may be included in the definition. To terminate the definition,
press the ENTER/RETURN key on a blank line. Once defined, the macro
cannot be edited within PCbug11. It may be edited using a standard text
editor once the file has been saved, since PCbug11 saves macros in a
special text format (see LOADM). Macros can also be defined by the user
using a text editor if the special format is used.

If the specified macro name already exists, then the existing macro is
overwritten by the new definition.

Usage:
DEFM CONFIG    Create macro called CONFIG
DEFM TRACE     Create macro which is executed after T command
DEFM AUTOSTART Create macro which can be executed automatically on
               startup of PCbug11.

Related commands:CLRM,DELM,EDITM,LOADM,LSTM,SAVEM
*DELM macroname|TRACE    - Delete Command or Trace Macro

As all macros must be accommodated within the free memory space
available on the PC, this command allows the user to free up space for
other definitions.

Usage:
DELM CONFIG    Remove CONFIG macro name and definition
DELM TRACE     Remove macro name and definition used by T (trace)
               command

Related commands: DEFM,CLRM,SAVEM,LOADM,LSTM
*DIR [mask]         - Display disk directory

This command causes the directory/contents specified by the mask to be
displayed. Standard DOS masks apply.

Usage:
DIR            Display contents of current directory
DIR *.MCR      Display all the files in the current directory with the
               extension .MCR (macros)
DIR \          Display all files in the root directory
DIR ..\*.PAS   Display all the files in the directory above the current
               one with the extension .PAS

Related command: TYPE
*DOS [command]           - Shell to DOS/Execute DOS command

If no command parameter specified, then DOS causes PCbug11 to shell to
MS-DOS?. To return to PCbug11, type EXIT at the DOS prompt. If a command
is specified, then PCbug11 will execute the command, and return to
PCbug11. Prior to returning, the program PCBUGRTN.EXE is executed (this
program must be stored in the same directory as PCBUG11.EXE). This
program can be user defined if required. The supplied version simply
displays a message and waits for any key press.

Usage:
DOS COPY *.TXT a:/V      Execute COPY command and return to PCbug11
*EDITM macrnam           - Edit a macro

This command allows the user to edit macros once they are defined/loaded
into PCbug11. It is a full screen editor type and uses various function
keys to edit the macros.

On executing the command PCbug11 displays the first 10 lines of the
macro or less if there are fewer lines in a new window. Each line is
preceded by a digit 0 to 9.

The editor obeys the following commands:

<alphanumeric>  Insert key pressed into the current macro text.
Character will replace current one if insert is off. If insert is on the
character will be inserted before current character.

<del>     The delete key will delete the character current under the
          cursor.

<ins>     Toggle insert function on/off. Default is on.

<enter>   Insert a new line in the macro.

<pgdn>    The page down key displays the 10 lines following the current
          cursor line.

<pgup>    The page up key displays the 10 lines before the current
          cursor line.

<esc>     The escape key aborts the edit. The macro is not saved.

<F3 key>  Complete edit and save alterations in macro library.
          Note ALT-Q and ALT-E will also perform this function.

Users move from line to line by pressing the arrow keys to move in the
direction indicated. Lines which do not contain any characters after the
edit are removed automatically. There is no direct command to delete a
line. If the first characters in the line are spaces then they are
removed

If the macro does not exist it is created as a null macro. If a null
macro is edited, only the first line is displayed (as a blank line).

Usage:
EDITM macro1        Edit the macro macro1.

Related commands: CLRM,DEFM,DELM,LOADM,LSTM,SAVEM
*EEPROM [startaddr [endaddr]]    - Display/Clear/Set EEPROM
                                   Address Range(s)

This command allows the user to transparently perform memory modify
operations on the 68HC11 internal EEPROM, including the CONFIG register.
Once an EEPROM address range is specified, all memory write operations
within that range will be handled by the appropriate EEPROM programming
algorithm. The command will not accept an address range which includes
the PPROG register.
Instructions affected: ASM, BR, LOADS, MM,MOVE, MS, NOBR, T

Usage:
EEPROM              Display memory address range to use EEPROM
                    algorithm.
EEPROM 0            Clear all EEPROM memory address ranges.
EEPROM $103F        Enable a write to address $103F to use EEPROM
                    algorithm.
EEPROM $B600 $B6FF  Enable writes within range $B600-$B6FF to use
                    EEPROM algorithm

------------------------------------------------------------------------

2/ EEPROM DELAY mS  - Set EEPROM erase/write programming time

This command allows the user to specify the EEPROM Erase and Write
programming time, within the range Min_delay to 255mS. The value of
Min_delay depends on the serial baud rate, since the EEPROM programming
algorithm used by PCbug11 relies on serial data transfer time. With a
9600 baud serial rate, the minimum delay time is 12mS. Note EPROM DELAY
has the same effect as this command, care should be taken when using
both commands.

Usage:
EEPROM DELAY 20     Sets the Erase and Write time delay to 20mS
EEPROM DELAY        Display the delay time in use

-----------------------------------------------------------------------

3/ EEPROM ERASE [option] [addr]    - Display/Change EEPROM Erase before
                                   Write function or bulk erase EEPROM.

This command allows the user to enable or disable EEPROM byte erasure
before byte programming. The default state is Erase-before-Write
Enabled. Another option of this command allows bulk erasure of the
EEPROM array at $B600-$B7FF, or at the address specified by <addr>.

Usage:
EEPROM ERASE             Display EEPROM Erase-before-Write state
EEPROM ERASE DISABLE     Disable EEPROM Erase-before-Write
EEPROM ERASE ENABLE      Enable EEPROM Erase-before-Write
EEPROM ERASE BULK        Bulk erase EEPROM array starting at $B600
EEPROM ERASE BULK $E000  Bulk erase EEPROM array starting at $E000

Note: After executing EEPROM ERASE BULK, Erase-before-Write is
automatically disabled. This allows the fastest download of S records to
EEPROM using the LOADS command. The bulk erase time defaults to
approximately 200mS. It is recommended that Erase-before-Write be
enabled before executing commands which may modify non-erased EEPROM.
e.g. ASM,BR,T
*EPROM [startaddr [endaddr]]     - Display/Clear/Set EEPROM Address
                                   Range(s)

This command allows the user to transparently perform memory modify
operations on the 68HC711 internal EPROM. Once an EPROM address range is
specified, all memory write operations within that range will be handled
by the EPROM programming algorithm. The command will not accept an
address range which includes EPROG/PPROG.

Note that in general the EPROM command will only operate if an external
programming voltage is applied. IN GENERAL THE PROGRAMMING VOLTAGE
SHOULD NOT BE PRESENT BEFORE Vcc IS PRESENT. ALSO THE PROGRAMMING
VOLTAGE SHOULD NOT BE PRESENT AFTER Vcc IS REMOVED. Also the programming
voltage is generally applied to the XIRQ pin and so an XIRQ talker may
not be used. PLEASE CONSULT THE HC11 DATA/INFORMATION SHEET BEFORE USING
PCbug11 WITH EPROM PROGRAMMING.

Instructions affected: ASM, LOADS, MOVE, MS, NOBR, T

Usage:
EPROM               Display memory address range to use EPROM
                    algorithm.
EPROM 0             Clear all EPROM memory address ranges.
EPROM $D000 $FFFF   Enable writes within range $D000-$FFFF to use
                    EPROM algorithm

------------------------------------------------------------------------

2/ EPROM DELAY mS   - Set EPROM erase/write programming time

This command allows the user to specify the EPROM Write programming
time, within the range Min_delay to 255mS. The value of Min_delay
depends on the serial baud rate, since the EPROM programming algorithm
used by PCbug11 relies on serial data transfer time. With a 9600 baud
serial rate, the minimum delay time is 12mS. Note EEPROM DELAY has the
same effect as this command, care should be taken when using both
commands.

Usage:
EEPROM DELAY 20     Sets the Erase and Write time delay to 20mS
EEPROM DELAY        Display the delay time in use
*FIND byte|word addr1 addr2     - Find a bit pattern in MCU memory

<word> is a 2 byte value.
This command will read and search through the memory address range
specified by the last 2 parameters in the command line. The addresses of
all occurrences of the 1st parameter (byte or word) are displayed in the
main window. The syntax above is the simplest form, where a byte
parameter is simply a value in range $00-$FF and a word is in the range
$100-$FFFF. A maximum pattern of 4 consecutive bytes may be searched
for. If the pattern contains leading $00s then the 1st parameter after
FIND must be the byte count of the pattern to search for.

Usage:
FIND $AA $E000 $E3FF          Find and display all occurrences of $AA in
                              address range $E000 to $E3FF inclusive.
FIND $AA55 $B600 $B7FF        Find and display all occurrences of $AA55
                              in 68HC11A1 EEPROM (Addresses $B600 to
                              $B7FF)
FIND $0012 $F800 $FFFF      Find and display all occurrences of $0012
                              in address range $F800 to $FFFF.
FIND $00 $1234 $C000 $DFFF  Find and display all occurrences of
                              $001234 in address range $C000 to $DFFF.

------------------------------------------------------------------------

2/ FIND mnemonic addr1 addr2  - Find a mnemonic in MCU memory

This syntax eases the search for specific assembler code. The wild card
operator ? may be used in the mnemonic operand to force a search for the
opcode only. If the mnemonic addressing mode is not an indexed one, then
its operand must be immediately preceded, without a space, by one of the
following 3 symbols as appropriate: # (immediate); < (direct); >
(extended)

Usage:
FIND LDAA >$1234 $E000 $E200  Find and display all occurrences of
                              LDAA >$1234 in address range $E000 to
                              $E200.
FIND LDAB $34,X $C230 $C560   Find and display all occurrences of
                              LDAB $34,X in address range $C230 to $C560
FIND LDX #? $F000 $F2FF       Find and display all occurrences of
                              immediate load X opcode in range $F000
                              to $F2FF

Note that a maximum of 4 characters can be searched for.
*G [addr]                     - Start user code execution

This command causes the 68HC11 to begin executing the user code. If
<addr> is not specified then execution will commence at the current
program counter. If <addr> is specified then execution will commence at
that address.

Usage:
G         Commence program execution at current program counter
G $B600   Commence program execution at $B600

Related command: S
*HELP [command]          - Display help information

This command displays help information in a window which is displayed on
top of the main window. If no <command> is specified then a general help
screen is displayed. The user may scroll through the help window by
using the up and down arrows and page up and page down keys. The user is
unable to alter the contents of the help information. The help window is
cleared by pressing the ESC key.

The help information is stored in a text file called PCBUG11.HLP. The
default help option is help MENU which displays the help available.

Usage:
HELP      Display general help menu ( same as HELP MENU)
HELP RS   Display help for RS command
*KLE      - Kill last error message

This command causes the last error/break point window to be cleared.

Usage:
KLE

Related commands: CLS
*LOADM [filename] [macroname] - Load Macro Definitions from
                              Default/User File and optionally
                              immediately execute macro.

This command loads a library of previously defined macros stored on disc
with the SAVEM command or created by the user using a text editor. The
format of the file is checked against the macro rules and is not loaded
if the format is not valid - see below. The newly loaded library is
added to any existing library. If <macroname> is specified, and exists
in the newly loaded library, it is immediately executed after loading.
The default extension for loading macro libraries is .MCR.

Usage:
LOADM          Loads macro library from default file PCBUG11.MCR
LOADM USERLIB  Loads macro library from files USERLIB.MCR
LOADM A A      Loads macro library from file A.MCR and immediately
               executes the macro named A.

Related commands: CLRM,DEFM,DELM,EDITM,LSTM,SAVEM


Valid text format for macro files

DEFM macroname
BEGIN
     macro_instructions
END

macroname is the name of the macro being defined
macro_instructions are the PCbug11 instructions which the macro contains

Comments are allowed and are enclosed in { } brackets.

Note that comments are stripped out by PCbug11 when loaded. If a library
is saved any comments present when the macros are loaded are lost.

Parameters are passed into macros by the @ symbol. That is @0 will be
replaced by the first parameter when calling the macro, @1 will be the
second etc.
*LOADS filename [loadaddr]    - Load S Record File into MCU
                              Memory, at optional new start address.

The <filename> parameter in the command is of the form <filename.ext>
If no extension is specified then .S19 is assumed by the monitor. The
default path is the current working directory, but the user may specify
any path and/or drive letter in accordance with the rules of MS-DOS?.
Only S1 records are loaded. All other S record types are ignored, as are
blank lines. Invalid format lines may generate an error message.

The S record data is normally loaded into MCU memory at the addresses
specified in the S1 record load address field. However, the S record
data can be relocated, during loading, to an alternative starting
address by including the required address on the command line. During
loading, PCbug11 traps certain mode-dependent user vectors, to give the
monitor priority - these vectors are:

In Bootstrap mode:  SWI   - Used for breakpoint and trace processing.
In External mode :  RESET - Used to start the monitor after a hardware
                         reset.
                    SWI   - Used for breakpoint and trace processing.
                    XIRQ  - Used by the external ACIA to provide highest
                         priority host communication.

Note that all these vectors are available to the user. The only
difference is that there is a slight speed overhead associated with
their execution. However, if no user breakpoints are defined, then user
SWI instructions will be executed in real time, with no monitor
overhead. Refer to the source listings of the appropriate talker code to
determine the effects of user RESET and XIRQ on your software.
*LS symbol          - Display Macro Names/Definitions

The currently defined symbols are listed by this command. The name
symbol may include the * terminator which indicates a wild card
character. This may appear only at the end of the symbol name The wild
card indicates any combination of letters is possible and is used to
display symbols of similar name.

Usage:
LS *           Display all symbols
LS one         Display value of symbol one
LS PORT*       Display all symbols which commence with the letters PORT.
*LSTM [macroname|TRACE]  - Display Macro Names/Definitions

This command displays either all macro names in the current library, or
the expanded definition of a specified macro. Where macro names are used
within a macro definition, the display on the screen is indented at each
nested level.

Usage:
LSTM           Display the names of all macros in the current library
LSTM CONFIG    Display the definition of macro CONFIG
LSTM TRACE     Display the definition of the macro used after execution
               of the T (trace) command.

Related commands: CLRM,DEFM,DELM,EDITM,LOADM,SAVEM
*MD startaddr [endaddr]  - Display MCU memory

This command displays the contents of memory starting at <startaddr> and
ending at <endaddr>. If <endaddr> is not specified then the contents of
<startaddr> and the following 15 locations are displayed.

Usage:
MD $1000       Display MCU memory addresses from $1000 to $100F
MD $C000 $CFFF Display MCU memory addresses from $C000 to $CFFF

Related commands: BF,DB,MS
*MM addr       - Modify memory from addr

This command modifies memory from the address specified in the command
line. The contents of each memory location selected are displayed and
the user may then alter this by entering a value or select the next
location by pressing return. Memory may also be stepped through by using
the up and down arrow keys. The memory modify is completed by pressing
the <ESC> key. If the memory area has been predefined as EEPROM or EPROM
then the modify will be transparent to the user into these areas. An '='
on the memory line will cause the current location to be modified and
then stay at the same address. The command is also terminated by having
a '.' on the line. Note that only hex digits are accepted and no digits
will be accepted on a line following a '.' .

Usage:
MM $100        Modify from address $100.

Related commands: MS
*MOVE addr1 addr2 addr3  - Move memory between addr1 and addr2 to addr3

This command performs a memory move. The contents of the source memory
locations are unaltered. The destination address is indicated by addr3
and will be filled with the contents of addr1 to addr2. If the memory
area has been predefined as EEPROM or EPROM then the move will be
transparent to the user into these areas.

Usage:
MOVE $100 $150 $200      Move $50 bytes from $100 to $200

*MS addr byte|word [byte|word]     - Set MCU Memory Byte(s) or Word(s)

This command forces 8 bit or 16 bit values into MCU memory, starting at
address <addr>. A maximum of 9 values (8 or 16 bit) can be specified
after parameter <addr>. Each value is written to consecutive addresses
starting at <addr>. If the starting address is in an EEPROM block (as
specified by the EEPROM command), then an EEPROM algorithm will be used
to store the value. This action is completely transparent to the user.

Note: When setting memory to $00, ensure that the $00 is not specified
in the most significant byte of a 16 bit value, as this will be
interpreted as an 8 bit value and may result in incorrect addressing of
MCU memory.

Usage:
MS $1000 $AA        Set MCU memory address $1000 to a value of $AA
MS $C000 $1234 $56  Set MCU memory addresses $C000,$C001,$C002 to
                    the values $12,$34,$56 respectively.
MS $50 $55AA $FF00  Set MCU memory addresses $50,$51,$52,$53 to the
                    values $55,$AA,$FF,$00 respectively.

Related commands: BF,MD
*MSG [string]       - Display Message in Main Window

Prints string to screen, without command line trace.
The RTS line (write protect control) can be toggled if <string> is ^P.
*NOBR [address]     - Remove all/specified Break Points

If no parameter is specified after the command, then all Breakpoints are
removed from the breakpoint table, and the SWI vector is restored to its
previous state. This implies that, if a user SWI vector had been
previously installed by the LOADS command, or was detected when PCbug11
was first started, then user SWIs will run in real time without
intervention by PCbug11. If a parameter is specified after the command,
then the breakpoint at that address is removed.

Usage:
NOBR           Remove all breakpoints, and restore previous SWI vector.
NOBR $E034     Remove breakpoint at address $E034.

Related Commands: BR
*PAUSE [mS]    - Wait for any Key Press/Delay Time

The PAUSE command is useful in macros, where macro execution is halted
until either a key is pressed, or the specified time has elapsed.
Continuation from a PAUSE command is also achieved when the byte value
$4B is received on the PC serial port. This allows the target MCU to
control the execution of PCbug11 macro commands.

Usage:
PAUSE          Suspend command execution until any key is pressed,
               or the value $4B is received on the PC serial port.
PAUSE 1000     Suspend command execution for 1000mS.

Related commands: WAIT
*PRINT         - Display PCbug11 revision number

This command displays the PCbug11 start up message. This shows the
Motorola copyright message and the revision number in use.

Usage:
PRINT     Display revision number

Related commands:VER
*PROTECT [startaddr [endaddr]]     - Display/Clear/Set Write Protected
                                   Address Range(s)

This command allows the user to inhibit PCbug11 from writing to any MCU
memory location, either internal or external. Once the command is
executed with an address or range of addresses, then PCbug11 will not
permit any memory modify operation from taking place on those locations.
If this is attempted, then an error message will appear to the right of
the command line, indicating that the command has been terminated
without modifying the memory location. Note that this command does not
inhibit the user's own MCU code from writing to memory addresses.
Instructions affected: ASM, BR, LOADS, MOVE, MS, NOBR, T

Usage:
PROTECT             Displays all 'write protected' memory address
                    ranges.
PROTECT 0           Clears all 'write protected' memory address ranges.
PROTECT $102B       Prevents PCbug11 from writing to BAUD register.
PROTECT $FFC0 $FFFF Prevents PCbug11 from changing 68HC11 vectors.
*QUIT [Y]           - Terminate PCbug11 session

This command causes PCbug11 to terminate. If <Y> is not specified then a
further prompt is required before the session is ended. No check is made
to see if breakpoints have been cleared or macros saved before the
command is carried out.

Usage:
QUIT      Terminate session (PCbug11 will confirm this with user)
QUIT Y    Terminate session without confirmation
*RD [T]             - Display/Trace MCU Registers

Without the option <T>, this command displays the current value of the
MCU's registers in the register window. With the option T, the registers
are displayed in the main window, allowing a continuous register trace
to be seen. The command can be executed while the MCU is executing user
code. By careful use of both options, the MCU state at a particular
point can be permanently frozen on screen, using the RD command alone,
whilst continuously displaying the newest state using the RD T option.

Related commands: RM,RS
*RESET [addr]  - MCU Hardware Reset with Existing/New Reset Vector.

This command causes the MCU to generate a hardware reset and optionally
start execution of user code at <addr> or at the address specified by a
previous RESET command. Once the reset occurs, the default
implementation of PCbug11 causes the talker code to re-initialised, and
then the MCU either idles, if no user specified address was given in the
command line, or the talker code jumps to the address specified by
<addr> on the command line. Note that once <addr> has been specified, it
is maintained in the talker code until replaced by another value.
Refer to the appropriate talker code source listing for details.

Note:
To simulate an external hardware reset, the RESET command forces the MCU
to generate an internal reset which also causes the external RESET pin
to go low. To produce the internal reset, the Clock Monitor Fail
detector is used. PCbug11 implements this by downloading and executing
the following code in a reserved area of RAM:
     STY cme_jmp    Clock monitor fail jump address
     STAA OPTION,X  OPTION=$39
     STAB TEST1,X   TEST1=$3E
     STOP
     JMP user_start <- in case STOP doesn't generate CME reset!

Where:
     Y=user reset address
     X=$1000   Default I/O register base address for M68HC11
     ACCA=$08  Enables the clock monitor in the OPTION reg.

The values passed to ACCB, CCR and Y depend on the MCU type & operating
mode.

In Bootstrap mode: If MCU is an 'A8, ACCB=0 to clear the DISR bit in
TEST1 reg.
For all other devices, ACCB=4 to force the clock monitor reset by
setting the FCM bit in TEST1 reg. For all devices, CCR=$40 to enable the
STOP instruction and I bit interrupts, and disable XIRQ to allow
execution of the instruction after STOP if all else fails! The user
reset address is $0000.

In External mode:  For all devices, ACCB=$0, since TEST1 is not
accessible in normal modes. CCR=$10 to enable STOP and XIRQ, and disable
I bit interrupts. The user reset address is defined by the user in the
appropriate .MAP file

Note also that the above reset code forces the value in the Clock
Monitor Fail vector, before starting user code execution. This means
that the user must dynamically assign this vector in software before
using the feature. The effect of this internal reset is identical to an
external hardware reset, except that the COP Clock Monitor fail vector
is taken instead of the RESET vector - provided the rising edge of the
reset output signal is not delayed by external capacitance. Refer to the
M68HC11 data book and User manual for details.
*RESTART [option]   - Restart PCbug11 with Same/New Option.

This command performs a complete restart of the monitor, and is
equivalent to typing the MS-DOS? command: PCBUG11 option. The only
difference is that command macros are retained. Assembler macros and
symbols are lost.

Usage:
RESTART        Restart monitor with option specified when PCbug11
               was first executed
RESTART -XE    Restart monitor with -XE option. Equivalent to
               typing command:PCBUG11 -XE

Note: RESTART is useful when complete communication failure occurs, or
when the MCU is given an external hardware reset in bootstrap mode.
*RM            - Modify MCU Registers in window

This command allows the MCU registers to be modified in the register
window using the normal keyboard editing keys. Each register is fielded
in its own section of the window. To move within and between fields, the
following keys are used:

Up arrow       -  Move back one register field
Down arrow     -  Move forward one register field
Left arrow     -  Move cursor backwards in current field
Right arrow    -  Move cursor forward in current field
Ins            -  Insert at current cursor position
Del            -  Delete at current cursor position
Return         -  Quit register edit and update all MCU registers
Esc            -  Quit register edit without changing MCU registers

Note: All fields, except SXHINZVC can be edited in decimal, binary or
hex format. The SXHINZVC field is in binary format only. After quitting
the edit the RD command is automatically run to confirm any register
changes.

Related commands: RD,RS
*RS register value       - Set value of MCU register

This command allows the user to force the value of any MCU register.
Only one register at a time may be set. The register window is also
updated.
Valid options for <register> are: PC, ACCA, ACCB, X, Y, CCR, SP

Usage:
RS ACCA $61    Set MCU accumulator A to value $61
Related commands: RD,RM
*S             - Stop user code execution

This command causes the 68HC11 to stop executing the user code.

Usage:
S              Stop program execution

Related command: G
*SHELL ["command" ;P]    - Shell to DOS/Execute DOS command

If no command parameter specified, then SHELL causes PCbug11 to shell to
MS-DOS?. To return to PCbug11, type EXIT at the DOS prompt. If a command
is specified, then PCbug11 will execute the command, and return to
PCbug11. Prior to returning, the program PCBUGRTN.EXE is executed (this
program must be stored in the same directory as PCBUG11.EXE). This
program can be user defined if required. The supplied version simply
displays a message and waits for any key press. If the ;P option is
specified then the command is executed and immediately returns to
PCbug11 without running PCBUGRTN.

Usage:
SHELL "COPY *.TXT a:/V"  Execute COPY command and return to PCbug11
*SAVEM [filename]        - Save Macro Definitions in Default/User File

This command saves on disc, the library of macros created by the DEFM
command. Macros are stored on a disc file with extension .MCR. These
files are normal text files and can be edited with standard text
editors. However, there is a special format used in the macro files
which the user must obey at all times if the macros are to be
successfully loaded in to PCbug11 again (see LOADM). If the file name is
omitted from the command, then the default name of PCBUG11 is used.

Note : Users should take care when saving a library to the same file
that the library was loaded from. If any comments existed in the
original library then they will be lost as PCbug11 strips out comments
when loading macros.

Usage:
SAVEM USERLIB  Save macro library in file USERLIB.MCR
SAVEM          Save macro library in default file PCBUG11.MCR
               (Equivalent to: SAVEM PCBUG11)

Related commands: CLRM,DEFM,DELM,EDITM,LOADM,LSTM,SAVEM
*T [addr]           - Trace User Code

This command single step traces program code from the address specified
by the PC value, or addr, to the next logical address. Executing the
command causes a SWI to be placed at the next executable address(es). If
a command macro called TRACE has been defined, it is executed on
completion of the T command.

A useful Trace macro is: RD
                         DASM *

If the next executable instruction involves a branch to the current
address, the trace is disabled, to allow the instruction to execute.
However, PCbug11 will still display the TRACE state. Since the Talker is
interrupt driven, this does not cause any hang-up of the monitor, and
all PCbug11 commands are still available.
*TERM [X1 Y1 X2 Y2]      - Simple windowed terminal emulator

With no options specified, this command starts a simple terminal
emulator using the currently defined terminal window. Initially this is
the entire screen area.
Optional values <X1>,<Y1>,<X2> and <Y2> redefine the window in which the
terminal emulator operates. Note that if used, all values must be
specified - their meanings are as follows:
     <X1> - Left column
     <Y1> - Top  row
     <X2> - Right column
     <Y2> - Bottom row

The values need to be specified only on the first use of the TERM
command - they remain in force until replaced by another set of values.
To quit the terminal emulator, press the Esc key.
*TYPE [filename]         - Display contents of filename

This command causes the contents of the file filename to be displayed.
Standard DOS path names apply.

Usage:
TYPE RUNTIME.MCR    Display contents file RUNTIME.MCR in current
                    directory
TYPE \TEMP.BIT      Display file TEMP.BIT in root directory
TYPE ..\LIST.PAS    Display the file LIST.PAS in the directory above the
                    current one

Related command: DIR
*UNDEF symbol            - Undefine a symbol

Remove symbol from the symbol table list. The * wildcard character may
be used. This character can only be used at the end of a symbol name and
indicates a random number of characters. The symbol * can be used on its
own and indicates ALL symbols - use with care!

Usage:
UNDEF one           Clear the symbol one
UNDEF PORT*         Clear all macros whose names begin with the letters
                    PORT
UNDEF *             Clear all macros
*VER                - Display PCbug11 revision number

This command displays the PCbug11 start up message. This shows the
Motorola copyright message and the revision number in use.

Usage:
VER  Display revision number

Related commands: PRINT
*VERF ERASE addr1 [addr2]     - Verify that memory contains $FF

This command checks that the memory area specified is erased. That is
contains $FF. If addr2 is not specified then the byte at addr1 is
checked. If addr2 is specified then the block of memory between addr1
and addr2 is checked. If the memory does not match, then the memory
locations which are not erased are displayed along with the value it
contains.

Usage:
VERF ERASE $100          Check address addr1 is erased
VERF ERASE $E000 $FFFF   Check address block from $E000 to $FFFF is
                         erased

------------------------------------------------------------------------

VERF SET addr1 addr2 value    - Verify that memory contains value

This command checks the contents of memory from addr1 to addr2 and
verifies that each byte is equal to value. If the location is not equal
to value then the memory value is displayed. Value is a single byte
value

Usage:
VERF SET $100 $1FF $35   Check that the block from $100 to $1FF contains
                         $35.

------------------------------------------------------------------------

VERF filename [loadaddr]      - Verify S Record File against memory.

The default extension of <filename> is .S19. The default path is the
current working directory, but the user may specify any path and/or
drive letter in accordance with the rules of MS-DOS?. Only S1 records
are verified. All other S record types are ignored, as are blank lines.
Invalid format lines may generate an error message.

The S record data is normally compared with MCU memory at the addresses
specified in the S1 record load address field. However, the S record
data can be compared to an alternative starting address by including the
required address on the command line as <loadaddr>.


Related command: LOADS
*WAIT[ms]                     - Wait for ms

The WAIT command is useful in macros, where macro execution is halted
until either a key is pressed, or the specified time has elapsed.
Continuation from a WAIT command is also achieved when the byte value
$4B is received on the PC serial port. This allows the target MCU to
control the execution of PCbug11 macro commands.

Usage:
WAIT      Suspend command execution until any key is pressed,
          or the value $4B is received on the PC serial port.
WAIT 1000 Suspend command execution for 1000mS.

Related commands:PAUSE

